<%--
  Created by IntelliJ IDEA.
  User: hejiahao
  Date: 2021/12/17
  Time: 10:09
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%
request.setCharacterEncoding("UTF-8");

String name = request.getParameter("name");
String password = request.getParameter("password");

session.setAttribute("mainUserName",name);
session.setAttribute("mainState","Is logged in");

if (name.equals("gentleman") && password.equals("123456")){
    response.sendRedirect("main.jsp");
}else{
	response.sendRedirect("failure.jsp");
}
%>
%>
<html>
<head>
    <title>Login successful</title>
</head>
<body>
<h1>Login successful</h1>
</body>
</html>
